package com.ccnf.controller;

import com.ccnf.core.bean.TokenParams;
import org.springframework.beans.factory.annotation.Autowired;

import javax.servlet.http.HttpServletRequest;

public class BaseController {

    @Autowired
    protected HttpServletRequest request;

    protected TokenParams getTokenParams() {
        Object tp = request.getAttribute("TP");
        if (tp != null && tp instanceof TokenParams) {
            TokenParams tokenParams = (TokenParams) tp;
            return tokenParams;
        }
        return null;
    }
}
